import {createApp} from 'vue'
import {createPinia} from 'pinia'
import {registerStore} from './stores'
import App from './App.vue'
import router from './router'
import {i18n} from "./i18n/index"


import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import '@/icons/iconfont/iconfont'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import './assets/main.css'
import SvgIcon from "@/components/SvgIcon/index.vue"

import WebIcon from "@/components/SvgIcon/web-icon.vue"
import 'virtual:svg-icons-register';

import "./permission";

const app = createApp(App)

app.use(createPinia())
// 注册 Pinia
registerStore()
app.use(ElementPlus)
app.use(router)
app.use(i18n)

//引入全局组件
app.component("svg-icon", SvgIcon);
app.component("web-icon", WebIcon);


for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}
app.mount('#app')
